<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var a=5;
        function test(){
            a=0;
            console.log(a);//0
            console.log(this.a);//5
            var a;
            console.log(a);//0
        }
        test();

        function foo(){
            this.count++;
        }
        foo.count=0;
        for(var i=0;i<10;i++){
            if(i%5){
                foo();
            }
        }
        console.log(foo.count);//0
    </script>
</body>
</html>